<%@include file="../common/head.jsp" %>
<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<script type="text/javascript">
	document.title = "登陆";
	function doRegister(){
		window.location.href='gotoRegister';
	}
</script>
<c:if test="${! empty msg }">
		<script type="text/javascript" language="javascript">
			window.onload = function() {
				var message = "${msg}";
				alert(message);
			}
		</script>
</c:if>

		<!-- Spring Security :the form must be submitted in POST -->
	<form class="form-signin" style="max-width: 300px" action="/loginCheck" method="post" >
		<c:if test="${param.error != null}"> 
    		<div class="alert alert-error">
        		登陆失败！
        		<c:if test="${SPRING_SECURITY_LAST_EXCEPTION != null}">
        			失败原因为:<c:out value="${SPRING_SECURITY_LAST_EXCEPTION.message}" />，错误的用户信息！
        		</c:if>
    		</div>
		</c:if>
		<c:if test="${param.logout != null }">
			<div class="alert alert-success">
				您已成功退出系统！
			</div>
		</c:if>
		<h2 class="form-signin-heading">请登录！</h2>
		<input class="input-block-level" name="username" type="text" value="" placeholder="username"/>
		<input class="input-block-level" name="password" type="password" value="" placeholder="Password"/> 
		<label class="checkbox"><input type="checkbox" value="remember-me" name="_spring_security_remember_me"></input>
        Remember me
        </label>
		<input type="submit" value="submit" class="btn btn-primary btn-small"/>&nbsp;&nbsp;
		<input type="button" value="register" onclick="doRegister();" class="btn btn-primary btn-small"/>
	</form>
	
</div>
<!-- 整体区域结束 -->	
</body>
</html>